package demo

import (
	"fmt"

	"github.com/gin-gonic/gin"
)

func UploadFiles() {
	Router := gin.Default()
	Router.POST("/upload", func(c *gin.Context) {
		form, err := c.MultipartForm()
		if err != nil {
			fmt.Println(err)
			return
		}

		for _, handlers := range form.File {
			for _, handler := range handlers {
				c.SaveUploadedFile(handler, "uploads/"+handler.Filename)
			}
		}
	})
	Router.Run(":8080")
}
